Skip to content

feat(indexer): recover missing blocks#488

Merged
rpanic merged 5 commits intodevelopfrom
feat/indexer-recover-blocks
Apr 20, 2026
Merged

feat(indexer): recover missing blocks#488
rpanic merged 5 commits intodevelopfrom
feat/indexer-recover-blocks

Conversation

@stanlou
Copy link
Copy Markdown
Collaborator

@stanlou stanlou commented Apr 2, 2026

closes #480

@stanlou stanlou requested a review from rpanic April 2, 2026 13:43
Comment thread packages/indexer/src/tasks/IndexBlockTask.ts Outdated
Comment thread packages/indexer/src/IndexerNotifier.ts
Comment thread packages/indexer/src/IndexerNotifier.ts Outdated
const currentHeight = await this.blockRepository.getCurrentBlockHeight();

if (incomingHeight > currentHeight) {
if (firstBlockHeight > currentHeight) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, I'd like a few comments here on why this works (internal consistency given by the DB) bcs that fact is not immediately apparent

input: IndexBlockTaskParameters[]
): Promise<IndexBlockResult> {
const incomingHeight = Number(input.block.height.toBigInt());
const firstBlockHeight = Number(input[0].block.height.toBigInt());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here - do we have the gurantee that those are in-order?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have two scenarios here:

  • In normal indexing, we only receive a single block.
  • If we receive multiple blocks, it means we’re indexing missing blocks that were generated using Array.from()

@rpanic rpanic merged commit c2f72a8 into develop Apr 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Indexer: Recovery missing blocks

2 participants